package com.wyhello.tube4.facade.impl;

import java.util.List;
import java.util.Map;

import com.wyhello.tube4.dao.AppendixDAO;
import com.wyhello.tube4.dao.BagRecordsDAO;
import com.wyhello.tube4.dao.ChangeRecordsDAO;
import com.wyhello.tube4.dao.DictionaryRecordsDAO;
import com.wyhello.tube4.dao.DrawRecordsDAO;
import com.wyhello.tube4.dao.LoginCheckingDAO;
import com.wyhello.tube4.dao.MaintenanceRecordsDAO;
import com.wyhello.tube4.dao.RealityRecordsDAO;
import com.wyhello.tube4.dao.PositionRecordsDAO;
import com.wyhello.tube4.dao.ResideRecordsDAO;
import com.wyhello.tube4.dao.TubeRecordsDAO;
import com.wyhello.tube4.dao.UserOperateDAO;
import com.wyhello.tube4.dao.WorkingRecordsDAO;
import com.wyhello.tube4.facade.TubeFacade;
import com.wyhello.tube4.pojo.Appendix;
import com.wyhello.tube4.pojo.Bag;
import com.wyhello.tube4.pojo.Dictionary; 
import com.wyhello.tube4.pojo.Draw;
import com.wyhello.tube4.pojo.Exchange;
import com.wyhello.tube4.pojo.Macroscopic;
import com.wyhello.tube4.pojo.Reality;
import com.wyhello.tube4.pojo.Position;
import com.wyhello.tube4.pojo.Reside;
import com.wyhello.tube4.pojo.Tube;
import com.wyhello.tube4.pojo.User;
import com.wyhello.tube4.pojo.Working;

public class TubeFacadeImpl implements TubeFacade{
	//DAO注入
	private LoginCheckingDAO loginCheckingDAO;
	private ResideRecordsDAO resideRecordsDAO;
	private MaintenanceRecordsDAO maintenanceRecordsDAO;
	private WorkingRecordsDAO workingRecordsDAO;
	private DictionaryRecordsDAO dictionaryRecordsDAO;
	private RealityRecordsDAO realityRecordsDAO;
	private UserOperateDAO userOperateDAO;
	private ChangeRecordsDAO changeRecordsDAO;
	private TubeRecordsDAO tubeRecordsDAO;
	private PositionRecordsDAO positionRecordsDAO;
	private DrawRecordsDAO drawRecordsDAO;
	private BagRecordsDAO bagRecordsDAO;
	private AppendixDAO appendixDAO;
	

	public LoginCheckingDAO getLoginCheckingDAO() {
		return loginCheckingDAO;
	}

	public void setLoginCheckingDAO(LoginCheckingDAO loginCheckingDAO) {
		this.loginCheckingDAO = loginCheckingDAO;
	}

	public ResideRecordsDAO getResideRecordsDAO() {
		return resideRecordsDAO;
	}

	public void setResideRecordsDAO(ResideRecordsDAO resideRecordsDAO) {
		this.resideRecordsDAO = resideRecordsDAO;
	}

	public TubeRecordsDAO getTubeRecordsDAO() {
		return tubeRecordsDAO;
	}


	public RealityRecordsDAO getRealityRecordsDAO() {
		return realityRecordsDAO;
	}

	public void setTubeRecordsDAO(TubeRecordsDAO tubeRecordsDAO) {
		this.tubeRecordsDAO = tubeRecordsDAO;
	}

	public PositionRecordsDAO getPositionRecordsDAO() {
		return positionRecordsDAO;
	}

	public void setPositionRecordsDAO(PositionRecordsDAO positionRecordsDAO) {
		this.positionRecordsDAO = positionRecordsDAO;
	}

	public DrawRecordsDAO getDrawRecordsDAO() {
		return drawRecordsDAO;
	}

	public UserOperateDAO getUserOperateDAO() {
		return userOperateDAO;
	}

	public void setUserOperateDAO(UserOperateDAO userOperateDAO) {
		this.userOperateDAO = userOperateDAO;
	}

	public void setDrawRecordsDAO(DrawRecordsDAO drawRecordsDAO) {
		this.drawRecordsDAO = drawRecordsDAO;
	}

	public ChangeRecordsDAO getChangeRecordsDAO() {
		return changeRecordsDAO;
	}

	public void setChangeRecordsDAO(ChangeRecordsDAO changeRecordsDAO) {
		this.changeRecordsDAO = changeRecordsDAO;
	}

	public void setRealityRecordsDAO(RealityRecordsDAO realityRecordsDAO) {
		this.realityRecordsDAO = realityRecordsDAO;
	}

	public BagRecordsDAO getBagRecordsDAO() {
		return bagRecordsDAO;
	}

	public void setBagRecordsDAO(BagRecordsDAO bagRecordsDAO) {
		this.bagRecordsDAO = bagRecordsDAO;
	}

	@Override
	public boolean saveReside(Reside reside) {
		return resideRecordsDAO.saveReside(reside);
	}

	@Override
	public int deleteReside(String ids) {
		return resideRecordsDAO.deleteReside(ids);
	}
	public void deleteOj(Reside reside){
		resideRecordsDAO.deleteOj(reside);
	}
	@Override
	public List<Reside> queryReside() {
		return resideRecordsDAO.queryReside();
	}

	@Override
	public Reside getResideById(int id) {
		return resideRecordsDAO.getResideById(id);
	}

	@Override
	public boolean updateReside(Reside reside) {
		return resideRecordsDAO.updateReside(reside);
	}
	@Override
	public List<Reside> queryResideByBoiler() {
		return resideRecordsDAO.queryResideByBoiler();
	}
	public List<Reside> queryResideByLevel(int level){
		return resideRecordsDAO.queryResideByLevel(level);
	}
	public MaintenanceRecordsDAO getMaintenanceRecordsDAO() {
		return maintenanceRecordsDAO;
	}

	public void setMaintenanceRecordsDAO(MaintenanceRecordsDAO maintenanceRecordsDAO) {
		this.maintenanceRecordsDAO = maintenanceRecordsDAO;
	}

	public WorkingRecordsDAO getWorkingRecordsDAO() {
		return workingRecordsDAO;
	}

	public void setWorkingRecordsDAO(WorkingRecordsDAO workingRecordsDAO) {
		this.workingRecordsDAO = workingRecordsDAO;
	}

	public DictionaryRecordsDAO getDictionaryRecordsDAO() {
		return dictionaryRecordsDAO;
	}

	public void setDictionaryRecordsDAO(DictionaryRecordsDAO dictionaryRecordsDAO) {
		this.dictionaryRecordsDAO = dictionaryRecordsDAO;
	}

	//面板方法实现
	@Override
	public User querylogin(User user) {
		return loginCheckingDAO.querylogin(user);
	}
	@Override
	public boolean updatepw(User user) {
		return loginCheckingDAO.updatepw(user);
	}
	@Override
	public boolean saveMacroscopic(Macroscopic macroscopic) {
		return maintenanceRecordsDAO.saveMacroscopic(macroscopic);
	}

	@Override
	public int deleteMacroscopic(String ids) {
		return maintenanceRecordsDAO.deleteMacroscopic(ids);
	}

	@Override
	public List<Macroscopic> queryMacroscopic(int offset) {
		return maintenanceRecordsDAO.queryMacroscopic(offset);
	}
	public List<Macroscopic> queryMacTime(int offset,String begin,String end){
		return maintenanceRecordsDAO.queryMacTime(offset, begin, end);
	}
	@Override
	public Macroscopic getMacroscopicById(int id) {
		return maintenanceRecordsDAO.getMacroscopicById(id);
	}

	@Override
	public boolean updateMacroscopic(Macroscopic macroscopic) {
		return maintenanceRecordsDAO.updateMacroscopic(macroscopic);
	}

	@Override
	public boolean saveWorking(Working working) {
		return workingRecordsDAO.saveWorking(working);
	}

	@Override
	public int deleteWorking(String ids) {
		return workingRecordsDAO.deleteWorking(ids);
	}

	@Override
	public List<Working> queryWorking() {
		return workingRecordsDAO.queryWorking();
	}

	@Override
	public Working getWorkingById(int id) {
		return workingRecordsDAO.getWorkingById(id);
	}

	@Override
	public boolean updateWorking(Working working) {
		return workingRecordsDAO.updateWorking(working);
	}

	@Override
	public List<Working> queryWorkingByResideId(int resideId) {
		return workingRecordsDAO.queryWorkingByResideId(resideId);
	}

	@Override
	public boolean saveDictionary(Dictionary dictionary) {
		return dictionaryRecordsDAO.saveDictionary(dictionary);
	}

	@Override
	public int deleteDictionary(String ids) {
		return dictionaryRecordsDAO.deleteDictionary(ids);
	}

	@Override
	public List<Dictionary> queryDictionary() {
		return dictionaryRecordsDAO.queryDictionary();
	}

	@Override
	public Dictionary getDictionaryById(int id) {
		return dictionaryRecordsDAO.getDictionaryById(id);
	}


	@Override
	public boolean saveReality(Reality reality) {
		return realityRecordsDAO.saveReality(reality);
	}

	@Override
	public int deleteReality(String ids) {
		return realityRecordsDAO.deleteReality(ids);
	}

	@Override
	public List<Reality> queryReality(int offset) {
		return realityRecordsDAO.queryReality(offset);
	}
	public List<Reality> queryRealTime(int offset,String begin,String end){
		return realityRecordsDAO.queryRealTime(offset, begin, end);
	}

	@Override
	public Reality getRealityById(int id) {
		return realityRecordsDAO.getRealityById(id);
	}

	@Override
	public boolean updateReality(Reality reality) {
		return realityRecordsDAO.updateReality(reality);
	}


	@Override
	public boolean saveTube(Tube tube) {
		return tubeRecordsDAO.saveTube(tube);
	}

	@Override
	public int deleteTube(String ids) {
		return tubeRecordsDAO.deleteTube(ids);
	}
	public void deleteTOj(Tube tube){
		tubeRecordsDAO.deleteTOj(tube);
	}
	@Override
	public List<Tube> queryTube() {
		return tubeRecordsDAO.queryTube();
	}

	@Override
	public Tube getTubeById(int id) {
		return tubeRecordsDAO.getTubeById(id);
	}

	@Override
	public boolean updateTube(Tube tube) {
		return tubeRecordsDAO.updateTube(tube);
	}

	@Override
	public int queryCountTubeByResideId(int resideId) {
		return tubeRecordsDAO.queryCountTubeByResideId(resideId);
	}
	@Override
	public boolean savePosition(Position position) {
		return positionRecordsDAO.savePosition(position);
	}

	@Override
	public int deletePosition(String ids) {
		return positionRecordsDAO.deletePosition(ids);
	}
	public void deletePOj(Position position){
		positionRecordsDAO.deletePOj(position);
	}
	@Override
	public List<Position> queryPosition() {
		return positionRecordsDAO.queryPosition();
	}

	@Override
	public Position getPositionById(int id) {
		return positionRecordsDAO.getPositionById(id);
	}

	@Override
	public boolean updatePosition(Position position) {
		return positionRecordsDAO.updatePosition(position);
	}

	@Override
	public int queryRealityMaxId(int positionId) {
		return realityRecordsDAO.queryRealityMaxId(positionId);
	}

	@Override
	public boolean saveUser(User user) {
		return userOperateDAO.saveUser(user);
	}

	@Override
	public int deleteUser(String ids) {
		return userOperateDAO.deleteUser(ids);
	}

	@Override
	public List<User> queryUser() {
		return userOperateDAO.queryUser();
	}

	@Override
	public User getUserById(int id) {
		return userOperateDAO.getUserById(id);
	}

	@Override
	public boolean updateUser(User user) {
		return userOperateDAO.updateUser(user);
	}

	@Override
	public void deleteUS(User user) {
		userOperateDAO.deleteUS(user);

	}

	@Override
	public List<Dictionary> queryDictionaryByType() {
		return dictionaryRecordsDAO.queryDictionaryByType();
	}

	@Override
	public boolean saveDraw(Draw Draw) {
		return drawRecordsDAO.saveDraw(Draw);
	}

	@Override
	public int deleteDraw(String ids) {
		return drawRecordsDAO.deleteDraw(ids);
	}

	@Override
	public List<Draw> queryDraw() {
		return drawRecordsDAO.queryDraw();
	}

	@Override
	public Draw getDrawById(int id) {
		return drawRecordsDAO.getDrawById(id);
	}

	@Override
	public boolean saveChange(Exchange change) {
		return changeRecordsDAO.saveChange(change);
	}
	
	@Override
	public boolean saveAppendix(Appendix appendix) {
		return appendixDAO.saveAppendix(appendix);
	}

	@Override
	public int deleteChange(String ids) {
		return changeRecordsDAO.deleteChange(ids);
	}

	@Override
	public List<Exchange> queryChange() {
		return changeRecordsDAO.queryChange();
	}

	@Override
	public Exchange getChangeById(int id) {
		return changeRecordsDAO.getChangeById(id);
	}

	@Override
	public boolean updateChange(Exchange change) {
		return changeRecordsDAO.updateChange(change);
	}

	@Override
	public int queryCountMacroscopic() {
		return maintenanceRecordsDAO.queryCountMacroscopic();
	}

	@Override
	public int queryCountReality() {
		return realityRecordsDAO.queryCountReality();
	}

	@Override
	public int queryCountMacTime(String begin, String end) {
		return maintenanceRecordsDAO.queryCountMacTime(begin, end);
	}
	@Override
	public int queryCountReaTime(String begin, String end){
		return realityRecordsDAO.queryCountReaTime(begin, end);
	}

	@Override
	public List<Dictionary> queryDictionaryByWeld() {
		return dictionaryRecordsDAO.queryDictionaryByWeld();
	}

	@Override
	public List<Dictionary> queryDictionaryByWire() {
		return dictionaryRecordsDAO.queryDictionaryByWire();
	}

	@Override
	public List<Reality> queryRealityTime(int positionId, String begin,
			String end, String type) {
		return realityRecordsDAO.queryRealityTime(positionId, begin, end, type);
	}

	@Override
	public List<Reality> queryRealityWarn() {
		return realityRecordsDAO.queryRealityWarn();
	}

	@Override
	public List<Working> queryWorkingForWarn() {
		return workingRecordsDAO.queryWorkingForWarn();
	}

	@Override
	public boolean saveBag(Bag bag) {
		return bagRecordsDAO.saveBag(bag);
	}

	@Override
	public int deleteBag(String ids) {
		return bagRecordsDAO.deleteBag(ids);
	}

	@Override
	public List<Bag> queryBag(int resideId) {
		return bagRecordsDAO.queryBag(resideId);
	}

	@Override
	public Bag getBagById(int id) {
		return bagRecordsDAO.getBagById(id);
	}

	@Override
	public boolean updateBag(Bag bag) {
		return bagRecordsDAO.updateBag(bag);
	}

	@Override
	public int queryBagMaxId(int resideId) {
		return bagRecordsDAO.queryBagMaxId(resideId);
	}

	@Override
	public List<Working> queryWorkingEndByResideId(int resideId) {
		return workingRecordsDAO.queryWorkingEndByResideId(resideId);
	}

	@Override
	public boolean queryNoWorkingEndByResideId(int resideId) {
		return workingRecordsDAO.queryNoWorkingEndByResideId(resideId);
	}

	@Override
	public String queryRealityMaxByPosIds(String field, String positionIds,String bagId) {
		return realityRecordsDAO.queryRealityMaxByPosIds(field, positionIds, bagId);
	}

	@Override
	public String queryRealityMinByPosIds(String field, String positionIds,String bagId) {
		return realityRecordsDAO.queryRealityMinByPosIds(field, positionIds, bagId);
	}

	@Override
	public String queryRealityAvgByPosIds(String field, String positionIds,String bagId) {
		return realityRecordsDAO.queryRealityAvgByPosIds(field, positionIds, bagId);
	}
	@Override
	public List<Macroscopic> queryMacroscopicTime(int positionId, String begin,
			String end){
		return maintenanceRecordsDAO.queryMacroscopicTime(positionId, begin, end);
	}

	@Override
	public List<Reside> queryResidesByParendID(int id) {
		return resideRecordsDAO.queryResidesByParendID(id);
	}

	@Override
	public int queryCountOfChildrenByParentId(int parentId) {
		return resideRecordsDAO.queryCountOfChildrenByParentId(parentId);
	}

	@Override
	public Map<Integer,List<Position>> getPositionsNotCheckedThisYear(int boilerId, int count) {
		return positionRecordsDAO.getPositionsNotCheckedThisYear(boilerId, count);
	}
	@Override
	public Map<Integer,List<Position>> getPositionsNotCheckedLasttime(int boilerId, int count) {
		return positionRecordsDAO.getPositionsNotCheckedLasttime(boilerId, count);
	}
	@Override
	public Map<Integer,List<Position>> getPositionNeverChecked(int boilerId, int count) {
		return positionRecordsDAO.getPositionNeverChecked(boilerId, count);
	}

	@Override
	public List getAnyliseRow(String field, String begin, String end, int rowId) {
		return realityRecordsDAO.getAnyliseRow(field, begin, end, rowId);
	}

	@Override
	public List getAnyliseSurface(String field, String begin, String end,
			int surfaceId) {
		return realityRecordsDAO.getAnyliseSurface(field, begin, end, surfaceId);
	}

	@Override
	public List getAnyliseBoiler(String field, String begin, String end,
			int boilerId) {
		return realityRecordsDAO.getAnyliseBoiler(field, begin, end, boilerId);
	}

	@Override
	public List getRealityPieRow(String realField, String warnField, int rowId) {
		return realityRecordsDAO.getRealityPieRow(realField, warnField, rowId);
	}

	@Override
	public List getRealityPieSurface(String realField, String warnField,
			int surfaceId) {
		return realityRecordsDAO.getRealityPieSurface(realField, warnField, surfaceId);
	}

	@Override
	public List getRealityPieBoiler(String realField, String warnField,
			int boilerId) {
		return realityRecordsDAO.getRealityPieBoiler(realField, warnField, boilerId);
		}

	@Override
	public List getMacroscopicPieRow(String field, int rowId) {
		return maintenanceRecordsDAO.getMacroscopicPieRow(field, rowId);
	}

	@Override
	public List getMacroscopicPieSurface(String field, int surfaceId) {
		return maintenanceRecordsDAO.getMacroscopicPieSurface(field, surfaceId);
	}

	@Override
	public List getMacroscopicPieBoiler(String field, int boilerId) {
		return maintenanceRecordsDAO.getMacroscopicPieBoiler(field, boilerId);
	}

	@Override
	public List<Reside> queryExchangeRowBySurfaceId(int surfaceid) {
		
		return changeRecordsDAO.queryExchangeRowBySurfaceId(surfaceid);
	}

	@Override
	public List<Tube> queryExchangeTubeByRowId(int rowid) {
		return changeRecordsDAO.queryExchangeTubeByRowId(rowid);
	}

	@Override
	public List<Position> queryExchangePositionByTubeId(int tubeid) {
		return changeRecordsDAO.queryExchangePositionByTubeId(tubeid);
	}

	@Override
	public List<Exchange> queryExchangeByPositionId(int positionid) {
		return changeRecordsDAO.queryExchangeByPositionId(positionid);
	}

	@Override
	public int deleteExchangeById(int id) {
		return changeRecordsDAO.deleteExchangeById(id);
	}

	public AppendixDAO getAppendixDAO() {
		return appendixDAO;
	}

	public void setAppendixDAO(AppendixDAO appendixDAO) {
		this.appendixDAO = appendixDAO;
	}

	public List<Appendix> getAppendixList(int objid,String objname)
	{
		return appendixDAO.queryAppendix(objid, objname);
	}

}
